import fetch from "../../utils/request";
import newAxios from '../../utils/authToken';
export function getAllUser() {
  let params = {
    pageNum: 0,
    pageSize: 0
  };
  return newAxios()({ url: "/api/user/getAllUsers", method: 'get', params });
}
export function loginForm(username, password) {
  let params = {
    username,
    password
  }
  return fetch({ url: "/api/login", method: 'post', params })
}
export function startEnable( userId) {
  let params = {
    id: userId,
  }
  return newAxios()({ url: '/api/user/disabledUser', method: 'get', params })
}
export function noEnable( userId) {
  let params = {
    id: userId,
  }
  return newAxios()({ url: '/api/user/enabledUser', method: 'get', params })
}
export function addOrganization( addValues) {

  return newAxios()({ url: '/api/user/addSuperUser', method: 'post', data: addValues })
}
export function removeOrg(userId) {
  let params = {
    id: userId
  }
  return newAxios()({ url: '/api/user/deleteUser', method: 'get', params })
}
export function saveEditInfo(editValue) {
  return newAxios()({ url: '/api/user/updateSuperUser', method: 'post', data: editValue })
}
export function orgConfirmPwd(pwdValue) {
  return newAxios()({ url: '/api/user/changePassword', method: 'post', data: pwdValue })
}
export function getAllChild(userId) {
  let params = {
    pageNum: 0,
    pageSize: 0,
    userId: userId
  }
  return newAxios()({ url: '/api/user/getSubUsers', method: 'get', params })
}
export function deleteSub(userId) {
  let params = {
    id: userId
  }
  return newAxios()({ url: '/api/user/deleteSubUser', method: 'get', params })
}
export function ableChildEnable(userId) {
  let params = {
    id: userId
  }
  return newAxios()({ url: '/api/user/disabledSubUser', method: 'get', params })
}
export function disableChildEnable(userId) {
  let params = {
    id: userId
  }
  return newAxios()({ url: '/api/user/enabledSubUser', method: 'get', params })
}
export function saveEditChild(editValue) {
  return newAxios()({ url: '/api/user/updateUser', method: 'post', data: editValue })
}
export function addChildInfo(addValue) {
  return newAxios()({ url: '/api/user/addUser', method: 'post', data: addValue })
}
export function childConfirmPwd(pwdValue) {
  return newAxios()({ url: '/api/user/changeSubPassword', method: 'post', data: pwdValue })

}
export function getTypeData() {
  let params = {
    pageNum: 0,
    pageSize: 0
  }
  return newAxios()({ url: '/api/catalogueManage/allCatalogueInfos3', method: 'get', params })
}
export function ableType(number) {
  let params = {
    number,
  }
  return newAxios()({ url: '/api/catalogueManage/disabled', method: 'post', params })
}
export function disableType(number) {
  let params = {
    number,
  }
  return newAxios()({ url: '/api/catalogueManage/enabled', method: 'post', params })
}
export function impowerType( number, orgId) {
  let params = {
    number,
    id: orgId
  };
  return newAxios()({ url: '/api/catalogueManage/authorize', method: 'get', params })
}
export function saveEditor(editValues) {
  return newAxios()({ url: '/api/catalogueManage/changeInfo3', method: 'post', data: editValues })
}
export function deleteCon( number) {
  let params = {
    number,
  }
  return newAxios()({ url: '/api/catalogueManage/delete', method: 'post', params })
}
export function getSupData() {
  return newAxios()({ url: '/api/catalogueManage/allCatalogueInfos4', method: 'get' })
}
export function changeSubNum( sendNumber) {
  let params = {
    superNumber: sendNumber
  };
  return newAxios()({ url: '/api/catalogueManage/getNumber', method: 'get', params })
}
export function addCataType( addValue) {
  return newAxios()({ url: '/api/catalogueManage/add', method: 'post', data: addValue })
}
export function getOrgImpower() {
  return newAxios()({ url: '/api/catalogueManage/allOrganization', method: 'get' })
}